import fetch from 'common/src/utils/fetch';
// 获取成绩类型列表
export function getCrossResultList(data) {
    return fetch({
        url: '/api/majorservice/crossResult/list',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}

// 修改
export function updateCrossResultType(data) {
    return fetch({
        url: '/api/majorservice/crossResult/edit',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}

// 查询大类信息
export function findClassPower(data) {
    return fetch({
        url: '/api/welcomeservice/tutorSchool/major/' + data,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}

// 导出成绩
export function exportCrossResult(data) {
    return fetch({
        url: '/api/majorservice/crossResult/export',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}

export function getReportStatus(key) {
    return fetch({
        url: `/api/majorservice/common/exportExcelResult/${key}`,
        method: 'get',
        showMask: false
    });
}

// 联动根据年级大类查询专业
export function getSubjectByGradeAndMajor(gradeId, majorCode) {
    return fetch({
        url: 'api/commonservice/campusProfession/findProfessionByBigProfession?grade=' + gradeId + '&bigProfessionCode=' + majorCode,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}
// 联动根据大类查询学院
export function queryCollegeByMajorCode(volunteerMajorId = '', gradeId = '') {
    return fetch({
        url: 'api/majorservice/crossResultType/queryCollegeByMajorCode?volunteerMajorId=' + volunteerMajorId + '&gradeId=' + gradeId,
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

// 查成绩类型
export function getResultType(gradeId, majorId, subjectId) {
    return fetch({
        url: '/api/majorservice/crossResultType/type',
        params: {
            gradeId: gradeId,
            majorId: majorId,
            subjectId: subjectId
        },
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
    });
}

export function getSubject(college, gradeId) {
  return fetch({
                 url: `/api/majorservice/common/subject?college=${college}&gradeId=${gradeId}`,
                 method: 'get',
                 showMask: false
               });
}

export function getMajor(subjectId, gradeId) {
  return fetch({
                 url: `/api/majorservice/common/major?subjectId=${subjectId}&gradeId=${gradeId}`,
                 method: 'get',
                 showMask: false
               });
}

export function getCollege(authId) {
  return fetch({
                 url: `/api/majorservice/common/college?authId=${authId}`,
                 method: 'get',
                 showMask: false
               });
}
